package com.ruoyi.business.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import com.ruoyi.common.utils.SecurityUtils;
import org.springframework.stereotype.Service;
import com.ruoyi.business.mapper.BusPipeNetworkMapper;
import com.ruoyi.business.domain.BusPipeNetwork;
import com.ruoyi.business.service.IBusPipeNetworkService;
import javax.annotation.Resource;

/**
 * 管网台账Service业务层处理
 * 
 * @author wf
 * @date 2024-07-18
 */
@Service
public class BusPipeNetworkServiceImpl implements IBusPipeNetworkService 
{
    @Resource
    private BusPipeNetworkMapper busPipeNetworkMapper;

    /**
     * 查询管网台账
     * 
     * @param id 管网台账主键
     * @return 管网台账
     */
    @Override
    public BusPipeNetwork selectBusPipeNetworkById(Long id)
    {
        return busPipeNetworkMapper.selectBusPipeNetworkById(id);
    }

    /**
     * 查询管网台账列表
     * 
     * @param busPipeNetwork 管网台账
     * @return 管网台账
     */
    @Override
    public List<BusPipeNetwork> selectBusPipeNetworkList(BusPipeNetwork busPipeNetwork)
    {
        return busPipeNetworkMapper.selectBusPipeNetworkList(busPipeNetwork);
    }

    /**
     * 新增管网台账
     * 
     * @param busPipeNetwork 管网台账
     * @return 结果
     */
    @Override
    public int insertBusPipeNetwork(BusPipeNetwork busPipeNetwork)
    {
        busPipeNetwork.setCreateUser(SecurityUtils.getUserId());
        busPipeNetwork.setCreateBy(SecurityUtils.getUsername());
        busPipeNetwork.setCreateTime(DateUtils.getNowDate());
        busPipeNetwork.setUpdateUser(SecurityUtils.getUserId());
        busPipeNetwork.setUpdateBy(SecurityUtils.getUsername());
        busPipeNetwork.setUpdateTime(DateUtils.getNowDate());
        return busPipeNetworkMapper.insertBusPipeNetwork(busPipeNetwork);
    }

    /**
     * 修改管网台账
     * 
     * @param busPipeNetwork 管网台账
     * @return 结果
     */
    @Override
    public int updateBusPipeNetwork(BusPipeNetwork busPipeNetwork)
    {
        busPipeNetwork.setUpdateUser(SecurityUtils.getUserId());
        busPipeNetwork.setUpdateBy(SecurityUtils.getUsername());
        busPipeNetwork.setUpdateTime(DateUtils.getNowDate());
        return busPipeNetworkMapper.updateBusPipeNetwork(busPipeNetwork);
    }

    /**
     * 批量删除管网台账
     * 
     * @param ids 需要删除的管网台账主键
     * @return 结果
     */
    @Override
    public int deleteBusPipeNetworkByIds(Long[] ids)
    {
        return busPipeNetworkMapper.deleteBusPipeNetworkByIds(ids);
    }

    /**
     * 删除管网台账信息
     * 
     * @param id 管网台账主键
     * @return 结果
     */
    @Override
    public int deleteBusPipeNetworkById(Long id)
    {
        return busPipeNetworkMapper.deleteBusPipeNetworkById(id);
    }
    /**
     * 功能描述：获取管数量
     *
     * @return {@link Integer }
     * @author ling
     * @date 2024/08/22 16:56
     */
    @Override
    public Integer getPipeNetworkCount() {
        return busPipeNetworkMapper.getPipeNetworkCount();
    }
}
